package com.sum.entry;

import com.sum.util.CellUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * Cell
 *
 * @author shuzh
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
@EqualsAndHashCode(of = {"colIndex", "rowIndex"})
public class Cell {

    // 列，从1开始
    private int colIndex;

    // 行，从1开始
    private int rowIndex;


    public Cell(int colIndex, int rowIndex) {
        this.colIndex = colIndex;
        this.rowIndex = rowIndex;
    }


    public String getName() {
        return String.format("%s%d",
                CellUtil.getColNameByIndex(this.colIndex), this.rowIndex);
    }
}
